* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 2.5em;
    color: #cb3837;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header h1 i {
    font-size: 1.2em;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.search-section, .compare-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.search-section h2, .compare-section h2 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4em;
}

.search-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input, .compare-textarea {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    min-width: 250px;
}

.search-input:focus, .compare-textarea:focus {
    outline: none;
    border-color: #cb3837;
    box-shadow: 0 0 0 3px rgba(203, 56, 55, 0.1);
}

.compare-textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.period-select {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.period-select:focus {
    outline: none;
    border-color: #cb3837;
}

.search-btn, .compare-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #cb3837, #e85a4f);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.search-btn:hover, .compare-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(203, 56, 55, 0.3);
}

.compare-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.compare-form .period-select,
.compare-form .compare-btn {
    align-self: flex-start;
}

.results-section {
    margin-top: 20px;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #666;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.loading i {
    margin-right: 10px;
    color: #cb3837;
}

.result-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.package-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.package-name {
    font-size: 1.8em;
    color: #cb3837;
    font-weight: bold;
}

.package-version {
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #666;
}

.download-count {
    font-size: 2.5em;
    color: #2ecc71;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
}

.package-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.info-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #cb3837;
}

.info-label {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.info-value {
    color: #666;
    word-break: break-all;
}

.compare-result {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.compare-grid {
    display: grid;
    gap: 20px;
}

.compare-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 5px solid #cb3837;
    transition: all 0.3s ease;
}

.compare-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.compare-package-info {
    flex: 1;
}

.compare-package-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.compare-package-desc {
    color: #666;
    font-size: 0.9em;
}

.compare-downloads {
    font-size: 1.5em;
    font-weight: bold;
    color: #2ecc71;
    text-align: right;
}

.chart-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-top: 20px;
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #c33;
    margin: 10px 0;
}

.hidden {
    display: none;
}

.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
}

.footer a {
    color: #fff;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2em;
        flex-direction: column;
        gap: 10px;
    }
    
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .package-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .package-info {
        grid-template-columns: 1fr;
    }
    
    .compare-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .compare-downloads {
        text-align: left;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card, .compare-result, .chart-container {
    animation: fadeIn 0.5s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cb3837;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a02e2e;
} 